<!DOCTYPE html>
<style>
* {
    outline: 1px solid black;
}
div {
    height: 100px;
    background: pink;
    transform: translate(0, -50%);
}
</style><body><div id="box">
